/*
// 用户行为监控模型 - 已注释
// 如需重新启用，请取消注释

using System.ComponentModel.DataAnnotations.Schema;

namespace Lzfy_His_Service.Models
{
    /// <summary>
    /// 用户行为日志模型
    /// </summary>
    public class UserBehaviorLog
    {
        public long Id { get; set; }
        
        [Column("user_id")]
        public string UserId { get; set; } = string.Empty;
        
        [Column("user_name")]
        public string? UserName { get; set; }
        
        [Column("session_id")]
        public string SessionId { get; set; } = string.Empty;
        
        [Column("task_detail_id")]
        public long? TaskDetailId { get; set; }
        
        [Column("patient_id")]
        public string? PatientId { get; set; }
        
        [Column("action_type")]
        public string ActionType { get; set; } = string.Empty;
        
        [Column("action_data")]
        public string? ActionData { get; set; }
        
        [Column("timestamp")]
        public DateTime Timestamp { get; set; }
        
        [Column("page_url")]
        public string? PageUrl { get; set; }
        
        [Column("user_agent")]
        public string? UserAgent { get; set; }
        
        [Column("ip_address")]
        public string? IpAddress { get; set; }
        
        [Column("created_at")]
        public DateTime CreatedAt { get; set; }
    }

    /// <summary>
    /// 用户操作会话模型
    /// </summary>
    public class UserOperationSession
    {
        public long Id { get; set; }
        
        [Column("session_id")]
        public string SessionId { get; set; } = string.Empty;
        
        [Column("user_id")]
        public string UserId { get; set; } = string.Empty;
        
        [Column("task_detail_id")]
        public long TaskDetailId { get; set; }
        
        [Column("patient_id")]
        public string PatientId { get; set; } = string.Empty;
        
        [Column("patient_name")]
        public string? PatientName { get; set; }
        
        [Column("phone_number")]
        public string? PhoneNumber { get; set; }
        
        [Column("start_time")]
        public DateTime StartTime { get; set; }
        
        [Column("phone_view_time")]
        public DateTime? PhoneViewTime { get; set; }
        
        [Column("first_input_time")]
        public DateTime? FirstInputTime { get; set; }
        
        [Column("last_input_time")]
        public DateTime? LastInputTime { get; set; }
        
        [Column("save_time")]
        public DateTime? SaveTime { get; set; }
        
        [Column("total_duration")]
        public int? TotalDuration { get; set; }
        
        [Column("phone_to_save_duration")]
        public int? PhoneToSaveDuration { get; set; }
        
        [Column("input_duration")]
        public int? InputDuration { get; set; }
        
        [Column("input_char_count")]
        public int? InputCharCount { get; set; }
        
        [Column("contact_result")]
        public string? ContactResult { get; set; }
        
        [Column("user_notes")]
        public string? UserNotes { get; set; }
        
        [Column("is_completed")]
        public bool IsCompleted { get; set; }
        
        [Column("risk_score")]
        public decimal? RiskScore { get; set; }
        
        [Column("risk_factors")]
        public string? RiskFactors { get; set; }
        
        [Column("created_at")]
        public DateTime CreatedAt { get; set; }
        
        [Column("updated_at")]
        public DateTime UpdatedAt { get; set; }
    }

    /// <summary>
    /// 行为分析规则模型
    /// </summary>
    public class BehaviorAnalysisRule
    {
        public int Id { get; set; }
        
        [Column("rule_name")]
        public string RuleName { get; set; } = string.Empty;
        
        [Column("rule_type")]
        public string RuleType { get; set; } = string.Empty;
        
        [Column("rule_description")]
        public string? RuleDescription { get; set; }
        
        [Column("min_duration")]
        public int? MinDuration { get; set; }
        
        [Column("max_duration")]
        public int? MaxDuration { get; set; }
        
        [Column("weight")]
        public decimal Weight { get; set; }
        
        [Column("is_active")]
        public bool IsActive { get; set; }
        
        [Column("created_at")]
        public DateTime CreatedAt { get; set; }
        
        [Column("updated_at")]
        public DateTime UpdatedAt { get; set; }
    }

    /// <summary>
    /// 用户行为统计模型
    /// </summary>
    public class UserBehaviorStatistics
    {
        public long Id { get; set; }
        
        [Column("user_id")]
        public string UserId { get; set; } = string.Empty;
        
        [Column("stat_date")]
        public DateTime StatDate { get; set; }
        
        [Column("total_operations")]
        public int TotalOperations { get; set; }
        
        [Column("completed_operations")]
        public int CompletedOperations { get; set; }
        
        [Column("avg_duration")]
        public decimal? AvgDuration { get; set; }
        
        [Column("min_duration")]
        public int? MinDuration { get; set; }
        
        [Column("max_duration")]
        public int? MaxDuration { get; set; }
        
        [Column("suspicious_operations")]
        public int SuspiciousOperations { get; set; }
        
        [Column("avg_risk_score")]
        public decimal? AvgRiskScore { get; set; }
        
        [Column("created_at")]
        public DateTime CreatedAt { get; set; }
        
        [Column("updated_at")]
        public DateTime UpdatedAt { get; set; }
    }

    /// <summary>
    /// 行为监控请求模型
    /// </summary>
    public class BehaviorTrackingRequest
    {
        public string SessionId { get; set; } = string.Empty;
        public string ActionType { get; set; } = string.Empty;
        public long? TaskDetailId { get; set; }
        public string? PatientId { get; set; }
        public object? ActionData { get; set; }
        public string? PageUrl { get; set; }
    }

    /// <summary>
    /// 行为分析结果模型
    /// </summary>
    public class BehaviorAnalysisResult
    {
        public string SessionId { get; set; } = string.Empty;
        public decimal RiskScore { get; set; }
        public List<string> RiskFactors { get; set; } = new();
        public bool IsSuspicious { get; set; }
        public string Recommendation { get; set; } = string.Empty;
    }

    /// <summary>
    /// 操作类型常量
    /// </summary>
    public static class ActionTypes
    {
        public const string SESSION_START = "SESSION_START";         // 会话开始
        public const string SESSION_COMPLETE = "SESSION_COMPLETE";   // 会话完成
        public const string VIEW_DETAILS = "VIEW_DETAILS";           // 查看详情
        public const string VIEW_PHONE = "VIEW_PHONE";               // 查看电话
        public const string COPY_PHONE = "COPY_PHONE";               // 复制电话
        public const string INPUT_NOTES = "INPUT_NOTES";             // 输入备注
        public const string SELECT_RESULT = "SELECT_RESULT";         // 选择联系结果
        public const string SAVE_CONTACT = "SAVE_CONTACT";           // 保存联系记录
        public const string CLOSE_DIALOG = "CLOSE_DIALOG";           // 关闭对话框
        public const string PAGE_FOCUS = "PAGE_FOCUS";               // 页面获得焦点
        public const string PAGE_BLUR = "PAGE_BLUR";                 // 页面失去焦点
        public const string MOUSE_MOVE = "MOUSE_MOVE";               // 鼠标移动
        public const string KEY_PRESS = "KEY_PRESS";                 // 按键
    }

    /// <summary>
    /// 风险等级常量
    /// </summary>
    public static class RiskLevels
    {
        public const decimal LOW = 0.0m;        // 低风险 0-2
        public const decimal MEDIUM = 2.0m;     // 中风险 2-5
        public const decimal HIGH = 5.0m;       // 高风险 5-8
        public const decimal CRITICAL = 8.0m;   // 极高风险 8-10
    }
}
*/